package com.zy.ivideo.controller;

import com.zy.ivideo.entity.ResponseEntity;
import com.zy.ivideo.entity.unionentity.IUnionVideoMutilEntity;
import com.zy.ivideo.service.VideoMutilEntityService;
import com.zy.ivideo.token.PassToken;
import com.zy.ivideo.utils.ResponseUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/videomulti")
@Api(value = "Multi模块API接口", description = "该模块提供Multi模块视频信息服务", tags = "Mulit视频信息模块")
public class VideoMultiController {
    @Autowired
    VideoMutilEntityService service;
    /**
     * 根据视频分类获取对应的视频信息
     * @param typeid
     * @param page
     * @param pagesize
     * @return
     */
    @PassToken
    @ApiOperation(value = "根据视频分类获取对应的视频信息", notes = "根据视频分类获取对应的视频信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "int", name = "typeid", value = "视频分类id", required = true),
            @ApiImplicitParam(dataType = "int", name = "page", value = "当前页数", required = true),
            @ApiImplicitParam(dataType = "int", name = "pagesize", value = "每页数据数", required = true),
    })
    @GetMapping("/getMutilVideoByTypeId")
    public ResponseEntity<List<IUnionVideoMutilEntity>> getMutilVideoByTypeId(int typeid, int page, int pagesize){
        return service.getMutilVideoByTypeId(typeid,page,pagesize);
    }

    /**
     * 获取推荐视频信息
     * @param page
     * @param pagesize
     * @return
     */
    @PassToken
    @ApiOperation(value = "获取推荐视频信息", notes = "获取推荐视频信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "int", name = "page", value = "当前页数", required = true),
            @ApiImplicitParam(dataType = "int", name = "pagesize", value = "每页数据数", required = true),
    })
    @GetMapping("/getRecommendMutilVideo")
    public ResponseEntity<List<IUnionVideoMutilEntity>> getRecommendMutilVideo(int page,int pagesize){
        return service.getRecommendMutilVideo(page,pagesize);
    }
}
